//app.js
import userService from './services/user';
App({
  onLaunch: function () {
    // 展示本地存储能力
 
    var logs = wx.getStorageSync('logs') || []
    logs.unshift(Date.now())
    wx.setStorageSync('logs', logs)

    userService.checkLogin().then(res => {
      console.log('check login success');
      // 用户为已登录状态
      this.globalData.userInfo = wx.getStorageSync('userInfo');
    }).catch(err => {
    })
  },
  globalData: {
    userInfo: {},
  }
})